Technical Field
The present disclosure relates to microcontrollers and, in particular, to general purpose input/output ports in microcontrollers.
Description of the Related Art
A general purpose input/output (GPIO) port is generally understood as a parallel digital input/output port of a microcontroller. With current microcontrollers, GPIO functions are organized by ports (A, B, C, etc.), with each port having a set of registers input/output registers to control it. Furthermore, to control whether the port is used for digital input or digital output, a direction register such as a tri-state control register can be provided. Increasingly, microcontrollers are “low pin count” devices.
When, as a consequence, a large number of peripherals are multiplexed onto each pin, it is unlikely that more than one to three GPIO functions will be available on any given port, once a user allocates the pins necessary for dedicated pin functions, such as UART (universal asynchronous receiver/transmitter), SPI (serial peripheral interface), I2C (Inter-integrated circuit), etc. This means that when the user wants a coherent (atomic, i.e., the ability to read or write the set of GPIO pins with a single CPU instruction) set of GPIO pins with more than a couple of pins, they must access multiple registers to drive data out on or sample data from those pins. This leads to limitations, such as the inability to drive all GPIO pins high at the same time, or to sample all GPIO pins at the same time.